package com.cyb.beta.service;

import com.cyb.beta.model.Role;
import com.cyb.beta.model.RoleResc;

import java.util.List;

/**
 * Created by Administrator on 2015/6/18.
 */
public class RoleService extends BaseService {
    public List<Role> getRoleList() {
        return Role.dao.searchAll();
    }

    public List<RoleResc> getRoleRescList(Role role) {
        return RoleResc.dao.searchRoleRescByRoleId(role.getInt(Role.ID));
    }

    public boolean deleteRoles(String[] ids) {
        //删除 关联信息
        return Role.dao.deleteByIds(ids) && RoleResc.dao.delete(ids);
    }

    public boolean deleteResc(RoleResc roleResc) {
        return RoleResc.dao.delete(roleResc);
    }
}
